# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rspec-expectations
_gemname=${pkgname#ruby-}
pkgver=3.11.0
pkgrel=1
pkgdesc="Provides a readable API to express expected outcomes of a code example in RSpec"
url="https://relishapp.com/rspec/rspec-expectations/"
arch="noarch"
license="MIT"
depends="ruby ruby-diff-lcs ruby-rspec-support~=${pkgver%.*}"
options="!check"  # rspec's tests are written in rspec
source="$pkgname-$pkgver.tar.gz::https://github.com/rspec/$_gemname/archive/v$pkgver.tar.gz
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Clean-up...
	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc
}

sha512sums="
209eabafe92db3de1a78524d98facda16b3f5fef11f8f0c8c74bc6fc68529c8d9a835a8196e84b8b8bdf828d548d4b00bb1acdd607cab14dad7874f55a42b0c6  ruby-rspec-expectations-3.11.0.tar.gz
1d477004521852e23d01b197187dbb434a2c7fd179e506c82a12e17f5d52470fe2a113112e7052b9479077eafa6759beb07c03301de1f8ea7f5c4643c92d8346  gemspec.patch
"
